<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" id="inp" />
    <script>
      // inp.onchange = function () {
      //   console.log('change触发了')
      // }
      // inp.oninput = function () {
      //   console.log('input触发了')
      // }
      const name = 'zzz'
      const obj = {
        a: 1,
        xxx: 2,
        // 写了[],则中括号中的name会当做变量去解析
        [name]: 3, // ['yyy']: 3 ===> yyy:3
      }
      console.log(obj)
      // console.log(obj.a)
      // console.log(obj['a'])
    </script>
  </body>
</html>
